package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.AddCdkActivityVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.CdkActivityInfo;
import com.sc.nft.mapper.CdkActivityInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * CDK活动(sc_cdk_activity_info)数据DAO
 *
 * @author Sun
 * @since 2023-03-29 11:26:13
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class CdkActivityInfoDao extends ServiceImpl<CdkActivityInfoMapper, CdkActivityInfo> {

    /**
     * 分页查询活动
     * @param page
     * @return
     */
    public Page<AddCdkActivityVO> getCdkActivityList(Page page,String name) {
        return baseMapper.getCdkActivityList(page,name);
    }

    /**
     * 扣减自定义兑换码库存呢
     * @param id
     */
    public void subStock(Long id) {
        baseMapper.subStock(id);
    }
}